<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="chapter" content="pd">

    <!-- For Facebook Sharing -->
    <meta property="og:url" content="http://students.brown.edu/seeing-theory/probability-distributions" />
    <meta property="og:type" content="article" />
    <meta property="og:title" content="Probability Distributions" />
    <meta property="og:description" content="A probability distribution specifies the relative likelihoods of all possible outcomes." />
    <meta property="og:image" content="http://students.brown.edu/seeing-theory/img/share/3.png" />
    <meta property="og:image:width" content="1200" />
    <meta property="og:image:height" content="630" />


    <title>Seeing Theory - Probability Distributions</title>
    <!-- CSS Imports -->
    <!--Fonts-->
    <link href="https://fonts.googleapis.com/css?family=Assistant:300,400,600,700" rel="stylesheet">
    <!--Font Awesome-->
    <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
    <!--Favicon-->
    <link rel="shortcut icon" type="image/png" href="../img/favicon.png" />
    <!-- General Chapter -->
    <link rel="stylesheet" type="text/css" href="../css/chapter-style.css">
    <!-- Specific Chapter -->
    <link rel="stylesheet" type="text/css" href="distributions.css">
    <!-- JavaScript Imports -->
    <!-- D3 -->
    <script src="../js/d3.min.js"></script>
    <!-- Jquery -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
    <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
    <!-- jstat -->
    <script src="../js/jstat.min.js"></script>
    <!-- MathJax -->
    <script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS_HTML"></script>
    <!-- Tool Tip -->
    <script src="../js/d3.tip.v0.6.3.js"></script>
    <!-- General Chapter -->
    <script src="../js/chapter.js"></script>
    <!-- Random Variable D3 Extentsion -->
    <script src="../js/d3.hexbin.min.js"></script>
    <!-- Visualizations -->
    <script src="distributions.js"></script>
    <!-- Google Analytics -->
    <script>
    (function(i, s, o, g, r, a, m) {
        i['GoogleAnalyticsObject'] = r;
        i[r] = i[r] || function() {
            (i[r].q = i[r].q || []).push(arguments)
        }, i[r].l = 1 * new Date();
        a = s.createElement(o),
            m = s.getElementsByTagName(o)[0];
        a.async = 1;
        a.src = g;
        m.parentNode.insertBefore(a, m)
    })(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');
    ga('create', 'UA-85617614-1', 'auto');
    ga('send', 'pageview');
    </script>

    <link rel="stylesheet" href="../css/jquery-ui.css">

</head>

<body id='3'>
    <div id="share-modal"></div>
    <div class="header">
        <div class="progress-bar">
            <div class="progress-bar-color"></div>
        </div>
        <div class="header-wrapper">
            <ul class="chapter-nav">
                <li>
                    <span onclick="openNav()" id="hamburger">&#9776; </span>
                </li>
                <li><a href="../index.html" id="seeing-theory">Seeing Theory</a></li>
                <li><a onclick='toTop()' id='display-chapter'>Chapter 3: Probability Distributions</a></li>
            </ul>
        </div>
    </div>
    <div class="col-left">
        <div class="col-left-wrapper">
            <div id="section0">
                <div class="chapter-intro">
                    <h4>Chapter 3</h4>
                    <h1>Probability Distributions</h1>
                    <p>A probability distribution specifies the relative likelihoods of all possible outcomes.
                    </p>
                </div>
                <div class="scroll-down"> <img src="../img/button/bottom-arrow.svg"></div>
            </div>
            <div id="section1">
                <div class="unit">
                    <h3>Random Variables</h3>
                    <p>Formally, a random variable is a function that assigns a real number to each outcome in the probability space. Define your own discrete random variable for the uniform probability space on the right and sample to find the empirical distribution.</p>
                    <p>Click and drag to select sections of the probability space, choose a real number value, then press "Submit."</p>
                    <div class="interactive-wrapper">
                        <form id="rvNewMap">
                            <div class="form-group-inline">
                                <input type="number" step="any" class="form-control" placeholder="value" id="mapValue" required>
                            </div>
                            <div class="form-group-inline">
                                <input type="submit" class="button-1" value="Submit"></input>
                            </div>
                        </form>
                    </div>
                    <div id="table" class="col-xs-3">
                        <table id="rvMap" class="table table-bordered">
                            <colgroup></colgroup>
                            <colgroup></colgroup>
                            <tbody>
                                <tr>
                                    <td>Color</td>
                                    <td>Value</td>
                                </tr>
                                <tr>
                                    <td><img src="./img/hexagon.svg" width="20px" /></td>
                                    <td>0</td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <p>Sample from probability space to generate the empirical distribution of your random variable.</p>
                    <div class="interactive-wrapper">
                    <div id="rvDist"></div>
                    <div class="button-1 sampleBtns" id="startRV">Sample Distribution</div>
                    <div class="button-1" id="resetRV">Reset</div>
                    </div>
                </div>
            </div>
            <div id="section2">
                <div class="unit">
                    <h3>Discrete and Continuous</h3>
                    <p>
                        There are two major classes of probability distributions.
                    </p>
                    <div class="interactive-wrapper slider-align">
                        <label class="radio-inline">Discrete
                            <input type="radio" name="distributions" value="discrete" checked=true>
                            <span class="checkmark"></span>
                        </label>
                        <label class="radio-inline">Continuous
                            <input type="radio" name="distributions" value="continuous">
                            <span class="checkmark"></span>
                        </label>
                    </div>
                    <div class="definition">
                        <p>A discrete random variable has a finite or countable number of possible values.</p> 

                        <p>If \( X \) is a discrete random variable, then there exists unique nonnegative functions, \( f(x) \) and \( F(x) \), such that the following are true:</p>

                        $$\begin{align*}P(X = x) &= f(x)\\P(X < x) &= F(x)\end{align*}$$

                        <p>Choose one of the following major discrete distributions to visualize. The probability mass function \( f(x) \) is shown in <span class="yellow-color">yellow</span> and the cumulative distribution function \( F(x) \) in <span class="orange-color">orange</span> (controlled by the slider).</p>
                        <div class="interactive-wrapper">
                            <select class="distributions st-dropdown">
                                <option disabled selected value> -- select a distribution -- </option>
                                <option value="bernoulli">Bernoulli</option>
                                <option value="binomialDiscrete">Binomial</option>
                                <option value="geometric">Geometric</option>
                                <option value="poisson">Poisson</option>
                                <option value="negbin">Negative Binomial</option>
                            </select>
                        </div>
                    </div>
                    <div class="definition" style="display:none">
                        <p>A continuous random variable takes on an uncountably infinite number of possible values (e.g. all real numbers).</p>

                        <p>If \( X \) is a continuous random variable, then there exists unique nonnegative functions, \( f(x) \) and \( F(x) \), such that the following are true:</p>

                        $$\begin{align*}P(a\leq X\leq b) &=\int^b_a f(x) dx\\P(X < x) &= F(x)\end{align*}$$

                        <p>Choose one of the following major continuous distributions to visualize. The probability density function \( f(x) \) is shown in <span class="yellow-color">yellow</span> and the cumulative distribution function \( F(x) \) in <span class="orange-color">orange</span> (controlled by the slider).</p>
                        <p></p>

                        <div class="interactive-wrapper">
                            <select class="distributions st-dropdown">
                                <option disabled selected> -- select a distribution -- </option>
                                <option value="uniform">Uniform</option>
                                <option value="normal">Normal</option>
                                <option value="studentt">Student T</option>
                                <option value="chisquare">Chi Squared</option>
                                <option value="exponential">Exponential</option>
                                <option value="centralF">F</option>
                                <option value="gamma">Gamma</option>
                                <option value="beta">Beta</option>
                            </select>
                        </div>
                    </div>
                    <br>
                    <div id="bernoulli" class="bernoulli distribution">
                        <p>A Bernoulli random variable takes the value 1 with probability of \(p\) and the value 0 with probability of \(1-p\). It is frequently used to represent binary experiments, such as a coin toss.</p>
                    </div>
                    <div id="binomialDiscrete" class="binomialDiscrete distribution">
                        <p>A binomial random variable is the sum of \(n\) independent Bernoulli random variables with parameter \(p\). It is frequently used to model the number of successes in a specified number of identical binary experiments, such as the number of heads in five coin tosses.</p>
                    </div>
                    <div id="negbin" class="negbin distribution">
                        <p>A negative binomial random variable counts the number of successes in a sequence of independent Bernoulli trials with parameter \(p\) before \(r\) failures occur. For example, this distribution could be used to model the number of heads that are flipped before three tails are observed in a sequence of coin tosses.</p>
                    </div>
                    <div id="geometric" class="geometric distribution">
                        <p>A geometric random variable counts the number of trials that are required to observe a single success, where each trial is independent and has success probability \(p\). For example, this distribution can be used to model the number of times a die must be rolled in order for a six to be observed.</p>
                    </div>
                    <div id="poisson" class="poisson distribution">
                        <p>A Poisson random variable counts the number of events occurring in a fixed interval of time or space, given that these events occur with an average rate \(\lambda\). This distribution has been used to model events such as meteor showers and goals in a soccer match.</p>
                    </div>
                    <div id="uniform" class="uniform distribution">
                        <p>The uniform distribution is a continuous distribution such that all intervals of equal length on the distribution's support have equal probability. For example, this distribution might be used to model people's full birth dates, where it is assumed that all times in the calendar year are equally likely.</p>
                    </div>
                    <div id="normal" class="normal distribution">
                        <p>The normal (or Gaussian) distribution has a bell-shaped density function and is used in the sciences to represent real-valued random variables that are assumed to be additively produced by many small effects. For example the normal distribution is used to model people's height, since height can be assumed to be the result of many small genetic and evironmental factors.</p>
                    </div>
                    <div id="studentt" class="studentt distribution">
                        <p>Student's t-distribution, or simply the t-distribution, arises when estimating the mean of a normally distributed population in situations where the sample size is small and population standard deviation is unknown.</p>
                    </div>
                    <div id="chisquare" class="chisquare distribution">
                        <p>A chi-squared random variable with \(k\) degrees of freedom is the sum of \(k\) independent and identically distributed squared standard normal random variables. It is often used in hypothesis testing and in the construction of <a href="../frequentist-inference/index.html#section2">confidence intervals</a>.</p>
                    </div>
                    <div id="exponential" class="exponential distribution">
                        <p>The exponential distribution is the continuous analogue of the geometric distribution. It is often used to model waiting times.</p>
                    </div>
                    <div id="centralF" class="centralF distribution">
                        <p>The F-distribution, also known as the Fisher–Snedecor distribution, arises frequently as the null distribution of a test statistic, most notably in the <a href="../regression-analysis/index.html#section3">analysis of variance</a>.</p>
                    </div>
                    <div id="gamma" class="gamma distribution">
                        <p>The gamma distribution is a general family of continuous probability distributions. The exponential and chi-squared distributions are special cases of the gamma distribution.</p>
                    </div>
                    <div id="beta" class="beta distribution">
                        <p>The beta distribution is a general family of continuous probability distributions bound between 0 and 1. The beta distribution is frequently used as a conjugate prior distribution in Bayesian statistics.</p>
                    </div>
                     </br>
                    <div class="interactive-wrapper">

                        <table id="descriptionTable" style="display:none" class="table table-bordered">
                            <colgroup></colgroup>
                            <colgroup></colgroup>
                            <colgroup></colgroup>
                            <tbody>
                                <tr>
                                    <td>
                                        <span class="definition">PMF</span>
                                        <span class="definition" style="display:none">Distribution</span>
                                    </td>
                                    <td>Mean</td>
                                    <td>Variance</td>
                                </tr>
                                <tr>
                                    <td>
                                        <div class="bernoulli distribution">\(f(x;p) = \begin{cases} p & \text{if } x = 1 \\ 1-p & \text{if } x = 0 \end{cases}\)
                                        </div>
                                        <div class="binomialDiscrete distribution">\( f(x; n,p) = \binom{n}{x}p^{x}(1-p)^{n-x}\)</div>
                                        <div class="negbin distribution">\(f(x; n,r,p) = \binom{x + r -1}{x}p^{x}(1-p)^{r}\)</div>
                                        <div class="geometric distribution">\( f(x; p) = (1-p)^{x}p\) </div>
                                        <div class="poisson distribution">\( f(x;\lambda) = \dfrac{\lambda^{x}e^{-\lambda}}{x!}\)</div>
                                        <div class="uniform distribution">\(f(x;a,b) = \left\{\begin{array}{ll} \dfrac{1}{b-a} \text{ for } x \in [a,b]\\ 0 \qquad \text{ otherwise } \end{array}\right.\)
                                        </div>
                                        <div class="normal distribution">\( f(x;\mu, \sigma^2) = \dfrac{1}{\sqrt{2\pi\sigma^{2}}} e^{-\dfrac{(x-\mu)^{2}}{2\sigma^{2}}}\)</div>
                                        <div class="studentt distribution">\(\dfrac{Z}{\sqrt{U/k}} \qquad \begin{array}{ll} Z \sim N(0,1)\\ U \sim \chi_{k} \end{array}\)
                                        </div>
                                        <div class="chisquare distribution">\(\sum_{i=1}^{k}Z_{i}^{2} \qquad Z_{i} \overset{i.i.d.}{\sim} N(0,1)\)</div>
                                        <div class="exponential distribution">\( f(x;\lambda) = \begin{cases} \lambda e^{-\lambda x} & \text{if } x \geq 0 \\ 0 & \text{otherwise} \end{cases} \)</div>
                                        <div class="centralF distribution">\(\dfrac{U_{1}/d_{1}}{U_{2}/d_{2}} \qquad \begin{array}{ll} U_{1} \sim \chi_{d_{1}}\\ U_{2} \sim \chi_{d_{2}} \end{array}\)
                                        </div>
                                        <div class="gamma distribution">\( f(x; k,\theta) = \dfrac{1}{\Gamma(k)\theta^{k}}x^{k-1}e^{-\dfrac{x}{\theta}}\)</div>
                                        <div class="beta distribution">\(f(x;\alpha,\beta) = \dfrac{\Gamma(\alpha + \beta)x^{\alpha - 1}(1-x)^{\beta - 1}}{\Gamma(\alpha)\Gamma(\beta)}\)</div>
                                    </td>
                                    <td>
                                        <div class="bernoulli distribution">\(p\)</div>
                                        <div class="binomialDiscrete distribution">\(np\)</div>
                                        <div class="negbin distribution">\(\dfrac{pr}{1-p}\)</div>
                                        <div class="geometric distribution">\(\dfrac{1}{p}\)</div>
                                        <div class="poisson distribution">\(\lambda\)</div>
                                        <div class="uniform distribution">\(\dfrac{a+b}{2}\)</div>
                                        <div class="normal distribution">\(\mu\)</div>
                                        <div class="studentt distribution">\(0\)</div>
                                        <div class="chisquare distribution">\(k\)</div>
                                        <div class="exponential distribution">\(\frac{1}{\lambda}\)</div>
                                        <div class="centralF distribution">\(\dfrac{d_{2}}{d_{2}-2}\)</div>
                                        <div class="gamma distribution">\(k\theta\)</div>
                                        <div class="beta distribution">\(\dfrac{\alpha}{\alpha + \beta}\)</div>
                                    </td>
                                    <td>
                                        <div class="bernoulli distribution">\(p(1-p)\)</div>
                                        <div class="binomialDiscrete distribution">\(np(1-p)\)</div>
                                        <div class="negbin distribution">\(\dfrac{pr}{(1-p)^{2}}\)</div>
                                        <div class="geometric distribution">\(\dfrac{1-p}{p^{2}}\)</div>
                                        <div class="poisson distribution">\(\lambda\)</div>
                                        <div class="uniform distribution">\(\dfrac{(b-a)^{2}}{12}\)</div>
                                        <div class="normal distribution">\(\sigma^{2}\)</div>
                                        <div class="studentt distribution">\(\dfrac{k}{k-2}\)</div>
                                        <div class="chisquare distribution">\(2k\)</div>
                                        <div class="exponential distribution">\(\frac{1}{\lambda^{2}}\)</div>
                                        <div class="centralF distribution">\(\dfrac{2d_{2}^{2}(d_{1} + d_{2} -2)}{d_{1}(d_{2}-2)^{2}(d_{2}-4)}\)</div>
                                        <div class="gamma distribution">\(k\theta^{2}\)</div>
                                        <div class="beta distribution">\(\dfrac{\alpha\beta}{(\alpha + \beta)^{2}(\alpha + \beta + 1)}\)</div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        </br> 
                        <div id="parameters">
                        <div class="interactive-wrapper">
                            <div id="bernoulli" class="bernoulli distribution">
                                <label for="bernoulliProbability">
                                    \(\large p\) = <span id="bernoulliProbability-value">0.5</span>
                                </label>
                                <input id="bernoulliProbability" class="inputDist blueSlider" type="range" min="0" max="1" step="0.01" value="0.5">
                            </div>
                            <div id="binomialDiscrete" class="binomialDiscrete distribution">
                                <label for="binomialDiscreteNumber">
                                    \(\large n\) = <span id="binomialDiscreteNumber-value">5</span>
                                </label>
                                <input id="binomialDiscreteNumber" class="inputDist blueSlider" type="range" min="1" max="20" step="1" value="5">
                                <br>
                                <label for="binomialDiscreteProbability">
                                    \(\large p\) = <span id="binomialDiscreteProbability-value">0.5</span>
                                </label>
                                <input id="binomialDiscreteProbability" class="inputDist blueSlider" type="range" min="0" max="1" step="0.01" value="0.5">
                            </div>
                            <div id="negbin" class="negbin distribution">
                                <label for="negbinNumber">
                                    \(\large r\) = <span id="negbinNumber-value">5</span>
                                </label>
                                <input id="negbinNumber" class="inputDist blueSlider" type="range" min="1" max="20" step="1" value="5">
                                <br>
                                <label for="negbinProbability">
                                    \(\large p\) = <span id="negbinProbability-value">0.5</span>
                                </label>
                                <input id="negbinProbability" class="inputDist blueSlider" type="range" min="0" max="1" step="0.01" value="0.5">
                            </div>
                            <div id="geometric" class="geometric distribution">
                                <label for="geometricProbability">
                                    \(\large p\) = <span id="geometricProbability-value">0.5</span>
                                </label>
                                <input id="geometricProbability" class="inputDist blueSlider" type="range" min="0" max="1" step="0.01" value="0.5">
                            </div>
                            <div id="poisson" class="poisson distribution">
                                <label for="poissonLambda">
                                    \(\large\lambda\) = <span id="poissonLambda-value">5</span>
                                </label>
                                <input id="poissonLambda" class="inputDist blueSlider" type="range" min="0.01" max="10" step="0.01" value="5">
                            </div>
                            <div id="uniform" class="uniform distribution">
                                <label for="uniformMin">
                                    \(\large a\) = <span id="uniformMin-value">-5</span>
                                </label>
                                <input id="uniformMin" class="inputDist blueSlider" type="range" min="-10" max="0" step="0.01" value="-5">
                                <br>
                                <label for="uniformMax">
                                    \(\large b\) = <span id="uniformMax-value">5</span>
                                </label>
                                <input id="uniformMax" class="inputDist blueSlider" type="range" min="0" max="10" step="0.01" value="5">
                            </div>
                            <div id="normal" class="normal distribution">
                                <label for="normalMean">
                                    \(\large \mu\) = <span id="normalMean-value">0</span>
                                </label>
                                <input id="normalMean" class="inputDist blueSlider" type="range" min="-10" max="10" step="0.01" value="0">
                                <br>
                                <label for="normalStd">
                                    \(\large \sigma\) = <span id="normalStd-value">1</span>
                                </label>
                                <input id="normalStd" class="inputDist blueSlider" type="range" min="0.01" max="5" step="0.01" value="1">
                            </div>
                            <div id="studentt" class="studentt distribution">
                                <label for="studenttDof">
                                    \(\large k\) = <span id="studenttDof-value">5</span>
                                </label>
                                <input id="studenttDof" class="inputDist blueSlider" type="range" min="1" max="20" step="1" value="5">
                            </div>
                            <div id="chisquare" class="chisquare distribution">
                                <label for="chisquaredDof">
                                    \(\large k\) = <span id="chisquareDof-value">5</span>
                                </label>
                                <input id="chisquareDof" class="inputDist blueSlider" type="range" min="1" max="20" step="1" value="5">
                            </div>
                            <div id="exponential" class="exponential distribution">
                                <label for="exponentialLambda">
                                    \(\large \lambda\) = <span id="exponentialLambda-value">5</span>
                                </label>
                                <input id="exponentialLambda" class="inputDist blueSlider" type="range" min="0.01" max="10" step="0.01" value="1">
                            </div>
                            <div id="centralF" class="centralF distribution">
                                <label for="centralFDof1">
                                    \(\large d_{1}\) = <span id="centralFDof1-value">5</span>
                                </label>
                                <input id="centralFDof1" class="inputDist blueSlider" type="range" min="1" max="20" step="1" value="5">
                                <br>
                                <label for="centralFDof2">
                                    \(\large d_{2}\) = <span id="centralFDof2-value">5</span>
                                </label>
                                <input id="centralFDof2" class="inputDist blueSlider" type="range" min="1" max="20" step="1" value="5">
                            </div>
                            <div id="gamma" class="gamma distribution">
                                <label for="gammaShape">
                                    \(\large k\) = <span id="gammaShape-value">5</span>
                                </label>
                                <input id="gammaShape" class="inputDist blueSlider" type="range" min="0.01" max="10" step="0.01" value="1">
                                <br>
                                <label for="gammaScale">
                                    \(\large \theta\) = <span id="gammaScale-value">5</span>
                                </label>
                                <input id="gammaScale" class="inputDist blueSlider" type="range" min="0.01" max="10" step="0.01" value="1">
                            </div>
                            <div id="beta" class="beta distribution">
                                <label for="betaAlpha">
                                    \(\large \alpha\) = <span id="betaAlpha-value">5</span>
                                </label>
                                <input id="betaAlpha" class="inputDist blueSlider" type="range" min="0.01" max="5" step="0.01" value="1">
                                <br>
                                <label for="betaBeta">
                                    \(\large \beta\) = <span id="betaBeta-value">5</span>
                                </label>
                                <input id="betaBeta" class="inputDist blueSlider" type="range" min="0.01" max="5" step="0.01" value="1">
                            </div>
                            
                        </div></div>
                        <div class="button-1" id="resetDist" style="display:none">Reset</div>
                    </div>
                </div>
            </div>
            <div id="section3">
                <div class="unit">
                    <h3>Central Limit Theorem</h3>
                    <p>The Central Limit Theorem (CLT) states that the sample mean of a sufficiently large number of i.i.d. random variables is approximately normally distributed. The larger the sample, the better the approximation.</p>
                    <p> Change the parameters \(\alpha\) and \(\beta\) to change the distribution from which to sample.</p>
                    <div class="interactive-wrapper">
                        <label for="alpha_clt">
                            \(\large \alpha\) = <span id="alpha_clt-value">1.00</span>
                        </label>
                        <input id="alpha_clt" class="inputDist blueSlider" type="range" min="0.1" max="5" step="0.01" value="1.00">
                        <br>
                        <label for="beta_clt">
                            \(\large \beta\) = <span id="beta_clt-value">1.00</span>
                        </label>
                        <input id="beta_clt" class="inputDist blueSlider" type="range" min="0.1" max="5" step="0.01" value="1.00">

                    </div>
                    <p> Choose the sample size and how many sample means should be computed (draw number), then press "Sample." Check the box to display the true distribution of the sample mean.</p>
                    <div class="interactive-wrapper">
                        <label for="sample">
                            Sample size = <span id="sample-value">1</span>
                        </label>
                        <input id="sample" class="inputDist greenSlider" type="range" min="1" max="15" step="1" value="1">
                        <br>
                        <label for="draws">
                            Draws = <span id="draws-value">1</span>
                        </label>
                        <input id="draws" class="inputDist greenSlider" type="range" min="1" max="50" step="1" value="1">
                        
                        <div class="form-group" >
                            <label class="form-check">Theoretical
                                <input class="form-check-input" id="theoretical" type="checkbox">
                                <span class="checkbox-mark"></span>
                            </label>
                        </div>
                        
                        <div class="button-1"  id="form_clt">Sample</div>
                    </div>
                    <p>This visualization was adapted from Philipp Plewa's fantastic visualization of the <a href="https://bl.ocks.org/pmplewa/4120c2929ede7e336d9b55b760e496f6">central limit theorem</a>.</p>
                </div>
            </div>
        </div>
        <div class="action-buttons">
            <ul>
                <a href="../doc/probability-distributions.pdf">
                    <li><i class="fa fa-file-text-o action-icon" aria-hidden="true"></i> <span>Download</span></li>
                </a>
                <a id="share-button" class="inline-share">

                    <li><i class="fa fa-share-square-o action-icon" aria-hidden="true"></i>Share</li>
                    <li><div id="share"></div></li>
                    <li><div id="share-modal"></div></li>

                </a>
            </ul>
        </div>
        <a href="../frequentist-inference/index.html">
            <div class="chapter-footer" id="next-chapter-color">
                <div class="chapter-footer-wrapper">
                    <h4>Next</h4>
                    <p id='next-chapter'>Frequentist Inference → </p>
                </div>
            </div>
        </a>
    </div>
    <div class="col-right">
        <div class='language-setting'>
            <select class="languageSetting">
                <option selected>English</option>
                <option data-url="cn.html">中文</option>
                <option data-url="es.html">Español</option>
            </select>
        </div>
        <div class="nav-section" id="section-0">
            <div class="nav-unit-wrapper" id='one'>
                <img src="../img/tiles/3-1.png">
                <span class="nav-unit-title"> Random Variable </span>
            </div>
            <div class="nav-unit-wrapper" id='two'>
                <img src="../img/tiles/3-2.png">
                <span class="nav-unit-title"> Discrete and Continuous </span>
            </div>
            <div class="nav-unit-wrapper" id='three'>
                <img src="../img/tiles/3-3.png">
                <span class="nav-unit-title"> Central Limit Theorem </span>
            </div>
        </div>
        <div class="visualization-section" id="section-1">
            <div class="visualization-wrapper" id="svgRV"></div>
        </div>
        <div class="visualization-section" id="section-2">
            <div class="visualization-wrapper" id="graphDist"></div>
        </div>
        <div class="visualization-section" id="section-3">
            <div class="visualization-wrapper" id="graph"></div>
        </div>
    </div>
    <div id="overlay">
        <div class="modal-header">
            <div class="closebtn" onclick="closeNav()">&times;</div>
            <ul>
                <li>
                    <select class="languageSetting">
                        <option selected>English</option>
                        <option data-url="cn.html">中文</option>
                        <option data-url="es.html">Español</option>
                    </select>
                </li>
                <li><a href="../index.html">HOME</a></li>
            </ul>
        </div>
        <div class="modal-wrapper">
            <div class="modal-chapter">
                <div id="chapter-text"><span>CHAPTER</span></div>
                <ul class="modal-chapter-titles">
                    <li id="bp-li">Basic Probability</li>
                    <li id="cp-li">Compound Probability</li>
                    <li id="pd-li" class="chapter-highlighted">Probability Distributions</li>
                    <li id="fi-li">Frequentist Inference</li>
                    <li id="bi-li">Bayesian Inference</li>
                    <li id="ra-li">Regression Analysis</li>
                </ul>
            </div>
            <div class="modal-visualization">
                <div id="bp">
                    <div class="nav-unit-wrapper-s tile1">
                        <img src="../img/tiles/1-1.png" class="nav-unit-tile-s">
                        <span class="nav-unit-title-s"> Chance Event </span>
                    </div>
                    <div class="nav-unit-wrapper-s tile2">
                        <img src="../img/tiles/1-2.png" class="nav-unit-tile-s">
                        <span class="nav-unit-title-s"> Expectation </span>
                    </div>
                    <div class="nav-unit-wrapper-s tile3">
                        <img src="../img/tiles/1-3.png" class="nav-unit-tile-s">
                        <span class="nav-unit-title-s"> Variance </span>
                    </div>
                </div>
                <div id="cp">
                    <div class="nav-unit-wrapper-s tile1">
                        <img src="../img/tiles/2-1.png" class="nav-unit-tile-s">
                        <span class="nav-unit-title-s"> Set Theory </span>
                    </div>
                    <div class="nav-unit-wrapper-s tile2">
                        <img src="../img/tiles/2-2.png" class="nav-unit-tile-s">
                        <span class="nav-unit-title-s"> Counting </span>
                    </div>
                    <div class="nav-unit-wrapper-s tile3">
                        <img src="../img/tiles/2-3.png" class="nav-unit-tile-s">
                        <span class="nav-unit-title-s"> Conditional Probability </span>
                    </div>
                </div>
                <div id="pd" class="current">
                    <div class="nav-unit-wrapper-s tile1">
                        <img src="../img/tiles/3-1.png" class="nav-unit-tile-s">
                        <span class="nav-unit-title-s"> Random Variable </span>
                    </div>
                    <div class="nav-unit-wrapper-s tile2">
                        <img src="../img/tiles/3-2.png" class="nav-unit-tile-s">
                        <span class="nav-unit-title-s"> Discrete and Continuous </span>
                    </div>
                    <div class="nav-unit-wrapper-s tile3">
                        <img src="../img/tiles/3-3.png" class="nav-unit-tile-s">
                        <span class="nav-unit-title-s"> Central Limit Theorem </span>
                    </div>
                </div>
                <div id="fi">
                    <div class="nav-unit-wrapper-s tile1">
                        <img src="../img/tiles/4-1.png" class="nav-unit-tile-s">
                        <span class="nav-unit-title-s"> Point Estimation </span>
                    </div>
                    <div class="nav-unit-wrapper-s tile2">
                        <img src="../img/tiles/4-2.png" class="nav-unit-tile-s">
                        <span class="nav-unit-title-s"> Confidence Interval </span>
                    </div>
                    <div class="nav-unit-wrapper-s tile3">
                        <img src="../img/tiles/4-3.png" class="nav-unit-tile-s">
                        <span class="nav-unit-title-s"> The Bootstrap </span>
                    </div>
                </div>
                <div id="bi">
                    <div class="nav-unit-wrapper-s tile1">
                        <img src="../img/tiles/5-1.png" class="nav-unit-tile-s">
                        <span class="nav-unit-title-s"> Bayes' Theorem </span>
                    </div>
                    <div class="nav-unit-wrapper-s tile2">
                        <img src="../img/tiles/5-2.png" class="nav-unit-tile-s">
                        <span class="nav-unit-title-s"> Likelihood Function </span>
                    </div>
                    <div class="nav-unit-wrapper-s tile3">
                        <img src="../img/tiles/5-3.png" class="nav-unit-tile-s">
                        <span class="nav-unit-title-s"> Prior to Posterior </span>
                    </div>
                </div>
                <div id="ra">
                    <div class="nav-unit-wrapper-s tile1">
                        <img src="../img/tiles/6-1.png" class="nav-unit-tile-s">
                        <span class="nav-unit-title-s"> Ordinary Least Squares </span>
                    </div>
                    <div class="nav-unit-wrapper-s tile2">
                        <img src="../img/tiles/6-2.png" class="nav-unit-tile-s">
                        <span class="nav-unit-title-s"> Correlation </span>
                    </div>
                    <div class="nav-unit-wrapper-s tile3">
                        <img src="../img/tiles/6-3.png" class="nav-unit-tile-s">
                        <span class="nav-unit-title-s"> Analysis of Variance </span>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- Share CSS and JavaScript -->
    <link rel="stylesheet" type="text/css" href="../css/jssocials.css" />
    <link rel="stylesheet" type="text/css" href="../css/jssocials-theme-flat.css" />
    <script src="../js/jssocials.min.js"></script>
    <script>
        $("#share").jsSocials({
            showLabel: false,
            showCount: false,
            shareIn: "popup",
            shares: ["email", "twitter", "facebook", "googleplus", "linkedin"]
        });

        $(".languageSetting").change(function() {
          var option = $(this).find('option:selected');
          window.location.href = option.data("url");
        });
    </script>
</body>

</html>